package org.misalen.web.admin.job;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.misalen.web.database.BaseRepository;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AdvertisingPeriodJob extends BaseRepository {
	SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

	@Scheduled(cron = "0 1 0 * * ? ")
	public void run() {
		proDriverUserRepository.updateTodayIncome(0);
		proUserRepository.updateTodayIncome(0);
		String dateString = formatter.format(new Date());
		proVideoRewardRepository.updateTimeLimit(dateString);
		proVideoInfoRepository.updateTimeLimit(dateString);
		// TODO 增加现金
		// System.err.println(sysAdminRepository);
	}

}
